package com.ftg.learn.chapter07;

public class LearnFor3 {

    public static void quanCha(int hang,int lie){

        for(int i = 0;i<hang;i++){
            for(int j = 0;j<lie;j++){
                if(i==lie-j-1 && i<=4 ||i==j && i<4){
                    System.out.print("*\t");
                }else if(j==0){
                    System.out.print("*\t");
                }else if(i==0){
                    System.out.print("*\t");
                }else if(i==hang-1){
                    System.out.print("*\t");
                }else if(j==lie-1){
                    System.out.print("*\t");
                }else{
                    System.out.print("\t");
                }
            }
            System.out.println();
        }

        for(int i = 0;i<hang;i++){
            for(int j = 0;j<lie;j++){
                if(i == lie - j - 1 || i == j){
                    System.out.print("*\t");
                }else if(j==0){
                    System.out.print("*\t");
                }else if(i==0){
                    System.out.print("*\t");
                }else if(i==hang-1){
                    System.out.print("*\t");
                }else if(j==lie-1){
                    System.out.print("*\t");
                }else{
                    System.out.print("\t");
                }
            }
            System.out.println();
        }
    }
}
